home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume17 / pps < prev    next >
Encoding:
Internet Message Format  |  1989-02-06  |  42.0 KB

  1. Subject:  v17i080:  PostScript pretty-printers for common languages, etc.
  2. Newsgroups: comp.sources.unix
  3. Approved: rsalz@uunet.UU.NET
  4.  
  5. Submitted-by: Smadi Paradise <rlgvax!smadi>
  6. Posting-number: Volume 17, Issue 80
  7. Archive-name: pps
  8.  
  9. Pps is a pretty printer for PostScript devices. It handles C, awk, sh,
  10. lisp, mail, PostScript and English; adding more languages is simple.
  11.  
  12. Pps is almost as fast as plain text-to-PostScript filters, so some
  13. people here use it daily for source-code listing.  Most of the work is
  14. done by the printer: Unix just separates the input into tokens, using
  15. different lex(1) programs for each language.
  16.  
  17. Slide does the same, but ``expands'' the output to fit over a full
  18. page. This is useful for making overhead projection transparencies.
  19.  
  20. Both pps and slide run on Sun, Vax, Gould, CCI, RT and other BSD
  21. machines; they used to cope with SVR2, but that was a long time ago.
  22.  
  23. On Paradise
  24. (a guest of) uunet!rlgvax!smadi
  25.  
  26. #! /bin/sh
  27. # This is a shell archive, meaning:
  28. # 1. Remove everything above the #! /bin/sh line.
  29. # 2. Save the resulting text in a file.
  30. # 3. Execute the file with /bin/sh (not csh) to create:
  31. #    READ_ME
  32. #    pps.man
  33. #    slide.man
  34. #    Makefile
  35. #    pps.h
  36. #    lind.c
  37. #    prc.c
  38. #    text.c
  39. #    awk.l
  40. #    c.l
  41. #    csh.l
  42. #    lisp.l
  43. #    mail.l
  44. #    ps.l
  45. #    sh.l
  46. #    pps.sh
  47. #    slide.sh
  48. #    pps.pro
  49. #    slide.pro
  50. #    fonts
  51. export PATH; PATH=/bin:/usr/bin:$PATH
  52. echo shar: "extracting 'READ_ME'" '(887 characters)'
  53. if test -f 'READ_ME'
  54. then
  55.     echo shar: "will not over-write existing file 'READ_ME'"
  56. else
  57. sed 's/^X//' << \SHAR_EOF > 'READ_ME'
  58. XPps is a pretty printer for PostScript devices. It handles C, awk, sh,
  59. Xlisp, mail, PostScript and English; adding more languages is simple.
  60. X
  61. XPps is almost as fast as plain text-to-PostScript filters, so some
  62. Xpeople here use it daily for source-code listing.  Most of the work is
  63. Xdone by the printer: Unix just separates the input into tokens, using
  64. Xdifferent lex(1) programs for each language.
  65. X
  66. XSlide does the same, but ``expands'' the output to fit over a full
  67. Xpage. This is useful for making overhead projection transparencies.
  68. X
  69. XBoth pps and slide run on Sun, Vax, Gould, CCI, RT and other BSD
  70. Xmachines; they used to cope with SVR2, but that was a long time ago.
  71. X
  72. XEdit the three first lines in Makefile to reflect your system
  73. Xconventions, then ``make install''.
  74. X
  75. XEnjoy!
  76. X
  77. XOn Paradise, The Hebrew University of Jerusalem, Israel.
  78. Xon@hujics.bitnet  on@humus.huji.ac.il  ...!mcvax!huji!on
  79. SHAR_EOF
  80. if test 887 -ne "`wc -c < 'READ_ME'`"
  81. then
  82.     echo shar: "error transmitting 'READ_ME'" '(should have been 887 characters)'
  83. fi
  84. fi
  85. echo shar: "extracting 'pps.man'" '(2206 characters)'
  86. if test -f 'pps.man'
  87. then
  88.     echo shar: "will not over-write existing file 'pps.man'"
  89. else
  90. sed 's/^X//' << \SHAR_EOF > 'pps.man'
  91. X.    \"$Header: pps.man,v 0.0 88/06/22 05:22:23 on Rel $
  92. X.TH PPS 1 huji.ac.il
  93. X.if '\*(lb''.ds lb Library
  94. X.if '\*(lg''.ds lg C, awk, csh...
  95. X.if t .ds tm \(tm
  96. X.SH NAME
  97. Xpps \- pretty printer for PostScript
  98. X.SH SYNOPSIS
  99. X.B pps 
  100. X[-h header] [-l language] [-s style] [-t tabs] [-v pitch] files
  101. X.SH DESCRIPTION
  102. X.B Pps
  103. Xtranslates its input
  104. X.I files
  105. Xto PostScript\*(tm
  106. Xfor printing on the
  107. XApple LaserWriter\*(tm and similar devices.
  108. XWhen no input files are specified
  109. X(or when a ``-'' is given)
  110. Xthe standard input is read.
  111. X.PP
  112. X.B Pps
  113. Xprints a header at the top of each page,
  114. Xsimilar to the one printed by
  115. X.BR pr(1) .
  116. XThe
  117. X.BI -h " text"
  118. Xflag replaces the file name in the header with
  119. X.IR text .
  120. XSubtitles
  121. Xare printed along the right edge of the page
  122. Xwhenever a new function is declared.
  123. X.PP
  124. XFormatting is language-sensitive:
  125. XThe input language is specified by the
  126. X.BI -l " language"
  127. Xflag
  128. X(default is C, see ``FILES'' below).
  129. X.PP
  130. XSince ``pretty'' is a matter of taste,
  131. Xthere are zillions of flags to modify the output style:
  132. X.IP "\fB-C \fP\fIfont\fP"
  133. XUse
  134. X.I font
  135. Xfor comments (default: New Century Schoolbook Roman).
  136. X.I Font
  137. Xshould be a PostScript name of an available font,
  138. Xor a reasonable abbreviation.
  139. X.IP "\fB-K \fP\fIfont\fP"
  140. XSame, for keywords
  141. X(default: \f(CBCourier-Bold\fP).
  142. X.IP "\fB-S \fP\fIfont\fP"
  143. XSame, for strings and character constant
  144. X(default: \f(COCourier-Oblique\fP).
  145. X.IP "\fB-I \fP\fIfont\fP"
  146. XSame, for the rest of the text (default: \fCCourier\fP).
  147. X.IP "\fB-n \fP\fIn\fP"
  148. Xprints line numbers every \fIn\fPth line (default 10).
  149. X.IP "\fB-t \fP\fIn\fP"
  150. Xsets the tab stops to be
  151. X.I n
  152. Xcharacters wide.
  153. XOn proportional spacing fonts,
  154. Xa character width is taken to be the width of
  155. Xthe letter ``n''
  156. Xof the normal font.
  157. X.IP "\fB-v \fP\fIn\fP"
  158. XSet the vertical pitch to be
  159. X.I n
  160. Xlines per inch
  161. X(default 7).
  162. X.PP
  163. X.IP "\fB-s \fPstyle"
  164. XSource a PostScript program in file
  165. X.I style
  166. Xto override some of the
  167. Xconstants and macros,
  168. Xhence get a different formatting style.
  169. X.SH FILES
  170. X.nf
  171. X\*(lb/{\*(lg} \-
  172. X    language sensitive front end processors
  173. X\*(lb/fonts \- list of font names and abbreviations
  174. X.fi
  175. X.SH "SEE ALSO"
  176. Xvgrind(1), pr(1)
  177. X.SH BUGS
  178. X.nf
  179. XFunction declarations are naively detected.
  180. XThere are too many options.
  181. X.fi
  182. SHAR_EOF
  183. if test 2206 -ne "`wc -c < 'pps.man'`"
  184. then
  185.     echo shar: "error transmitting 'pps.man'" '(should have been 2206 characters)'
  186. fi
  187. fi
  188. echo shar: "extracting 'slide.man'" '(879 characters)'
  189. if test -f 'slide.man'
  190. then
  191.     echo shar: "will not over-write existing file 'slide.man'"
  192. else
  193. sed 's/^X//' << \SHAR_EOF > 'slide.man'
  194. X.    \"$Header: slide.man,v 0.0 88/06/22 05:22:41 on Rel $
  195. X.TH SLIDE 1 huji.ac.il
  196. X.if '\*(lb''.ds lb Library
  197. X.if '\*(lg''.ds lg C, awk, csh...
  198. X.if t .ds tm \(tm
  199. X.SH NAME
  200. Xslide \- produce overhead transparencies on a PostScript printer
  201. X.SH SYNOPSIS
  202. X.B slide
  203. X[-l language] [-t tabs] files
  204. X.SH DESCRIPTION
  205. X.B Slide
  206. Xproduces a PostScript\*(tm program that prints
  207. X.I files
  208. Xon the Apple LaserWriter\*(tm and similar devices.
  209. XThe output scale is set
  210. Xso the largest file
  211. Xfits on a single page.
  212. X.PP
  213. XFormatting is language-sensitive:
  214. XThe input language is specified by the
  215. X.BI -l " language"
  216. Xflag
  217. X(default is C, see ``FILES'' below).
  218. X.PP
  219. XThe
  220. X"\fB-t \fP\fIn\fP"
  221. Xflag
  222. Xsets the tab stops to be
  223. X.I n
  224. Xcharacters wide.
  225. X.SH FILES
  226. X.nf
  227. X\*(lb/{\*(lg} \-
  228. X    language sensitive front end processors
  229. X.fi
  230. X.SH "SEE ALSO"
  231. Xpps(1), vgrind(1)
  232. X.SH BUGS
  233. X.nf
  234. XSlides full of code may bore your audience to death.
  235. X.fi
  236. SHAR_EOF
  237. if test 879 -ne "`wc -c < 'slide.man'`"
  238. then
  239.     echo shar: "error transmitting 'slide.man'" '(should have been 879 characters)'
  240. fi
  241. fi
  242. echo shar: "extracting 'Makefile'" '(1642 characters)'
  243. if test -f 'Makefile'
  244. then
  245.     echo shar: "will not over-write existing file 'Makefile'"
  246. else
  247. sed 's/^X//' << \SHAR_EOF > 'Makefile'
  248. X# $Header: Makefile,v 0.0 88/06/22 05:21:37 on Rel $
  249. X# Edit the three lines below to suit your system conventions
  250. XBIN = .
  251. XLIB = .
  252. XCHAP = n
  253. XMAN = /usr/man/man$(CHAP)
  254. X
  255. XLANG = awk c csh lisp mail ps text sh
  256. XAUX = prc
  257. XPRO = *.pro
  258. XFRONT = pps slide
  259. XMANS = pps.$(CHAP) slide.$(CHAP)
  260. XSOURCES = READ_ME *.man Makefile *.h *.c *.l *.sh *.pro fonts
  261. XAR = shar
  262. XARFLG = -a
  263. X
  264. X.SUFFIXES: .$(CHAP) .man
  265. X
  266. X.man.$(CHAP):
  267. X    echo .ds lb $(LIB) > $@
  268. X    echo $(LANG) | sed 's/ /,/g;s/^/.ds lg /' >> $@ 
  269. X    cat $*.man >> $@
  270. X
  271. X
  272. Xall: $(LANG) $(AUX) $(FRONT) $(MANS)
  273. X
  274. X
  275. Xawk: awk.o lind.o
  276. X    $(CC) $(CFLAGS) -o $@ $@.o lind.o -ll
  277. X
  278. Xc: c.o lind.o
  279. X    $(CC) $(CFLAGS) -o $@ $@.o lind.o -ll
  280. X
  281. Xcsh: csh.o lind.o
  282. X    $(CC) $(CFLAGS) -o $@ $@.o lind.o -ll
  283. X
  284. Xmail: mail.o lind.o
  285. X    $(CC) $(CFLAGS) -o $@ $@.o lind.o -ll
  286. X
  287. Xps: ps.o lind.o
  288. X    $(CC) $(CFLAGS) -o $@ $@.o lind.o -ll
  289. X
  290. Xsh: sh.o lind.o
  291. X    $(CC) $(CFLAGS) -o $@ $@.o lind.o -ll
  292. X
  293. Xtext: text.o lind.o
  294. X    $(CC) $(CFLAGS) -o $@ $@.o lind.o -ll
  295. X
  296. Xlisp: lisp.o lind.o
  297. X    @echo warning: $@ has no built-ins -- see comment.
  298. X    $(CC) $(CFLAGS) -o $@ $@.o lind.o -ll
  299. X
  300. Xawk.o c.o csh.o sh.o lisp.o: pps.h
  301. X
  302. X
  303. Xpps: pps.sh
  304. X    sed 's|^lib=.*|lib=$(LIB)|' pps.sh > $@
  305. X    chmod 755 $@
  306. X
  307. Xslide: slide.sh
  308. X    sed 's|^lib=.*|lib=$(LIB)|' slide.sh > $@
  309. X    chmod 755 $@
  310. X
  311. X
  312. Xprc: prc.c
  313. X    $(CC) $(CFLAGS) -o $@ prc.c
  314. X
  315. X
  316. Xinstall: $(LIB) $(BIN) $(MAN)
  317. X
  318. X$(LIB): $(LANG) $(AUX) $(PRO) fonts
  319. X    -(cd $@; rm -f $(PRO) fonts) || mkdir $@
  320. X    cp $(LANG) $(AUX) $(PRO) fonts $@
  321. X
  322. X$(BIN): $(FRONT)
  323. X    cp $(FRONT) $@
  324. X
  325. X$(MAN): $(MANS)
  326. X    cp $(MANS) $@
  327. X    man pps > /dev/null
  328. X    man slide > /dev/null
  329. X
  330. X
  331. Xpps.$(AR): $(SOURCES)
  332. X    $(AR) $(ARFLG) $(SOURCES) > $@
  333. X
  334. Xclean:
  335. X    rm -f $(FRONT) $(LANG) $(AUX) $(MANS) *.o pps.$(AR)
  336. SHAR_EOF
  337. if test 1642 -ne "`wc -c < 'Makefile'`"
  338. then
  339.     echo shar: "error transmitting 'Makefile'" '(should have been 1642 characters)'
  340. fi
  341. fi
  342. echo shar: "extracting 'pps.h'" '(400 characters)'
  343. if test -f 'pps.h'
  344. then
  345.     echo shar: "will not over-write existing file 'pps.h'"
  346. else
  347. sed 's/^X//' << \SHAR_EOF > 'pps.h'
  348. X/* $Header: pps.h,v 0.0 88/06/22 05:22:20 on Rel $ */
  349. X/*
  350. X * Interface from lex front-end to pps.c
  351. X */
  352. X/*
  353. X * The postscript routines assume that *font is one of the following: 
  354. X *    I - variables and operators.
  355. X *    C - comments
  356. X *    S - strings
  357. X *    K - keywords
  358. X */
  359. Xextern char *font;
  360. X#define begin(S)    (sput(), (BEGIN (S)), font = "S") /* Yech! */
  361. X
  362. X#ifdef ECHO
  363. X#undef ECHO
  364. X#endif
  365. X#define ECHO        echo(yytext)
  366. SHAR_EOF
  367. if test 400 -ne "`wc -c < 'pps.h'`"
  368. then
  369.     echo shar: "error transmitting 'pps.h'" '(should have been 400 characters)'
  370. fi
  371. fi
  372. echo shar: "extracting 'lind.c'" '(2824 characters)'
  373. if test -f 'lind.c'
  374. then
  375.     echo shar: "will not over-write existing file 'lind.c'"
  376. else
  377. sed 's/^X//' << \SHAR_EOF > 'lind.c'
  378. X#ifndef lint
  379. Xstatic char rcsid[] = "$Header: lind.c,v 0.0 88/06/22 05:22:17 on Rel $";
  380. X#endif
  381. X#include <stdio.h>
  382. X#include <sys/types.h>
  383. X#include <sys/stat.h>
  384. X
  385. X/*
  386. X * Language-independent PostScript Interface.
  387. X *
  388. X * Use language dependent yylex() to output Postscript Macros:
  389. X * (string) fname - take string to be the current filename.
  390. X * (string) funct - take string to be the current function name.
  391. X * (string) Font s - put string at current location, using Font.
  392. X * n t - put n tabs
  393. X * n n - put n newlines
  394. X * n f - put n newpages
  395. X */
  396. Xextern char *keywords[];    /* must be defined in lexer */
  397. XFILE *yyin;
  398. XFILE *yyout;
  399. X#define yyoutput(C)    putc((C), yyout)
  400. X
  401. Xchar *font = "INITIAL";
  402. Xint bdone;    /* a string is being output */
  403. X
  404. X/*
  405. X * Print yytext[], escaping postscript 'dirty' characters.
  406. X * Start a postscript string output sequence, if necessary.
  407. X */
  408. Xecho(cp)
  409. Xregister char *cp;
  410. X{
  411. X    if (!*cp)
  412. X        return;
  413. X
  414. X    if (bdone++ == 0)
  415. X        yyoutput('(');
  416. X    for (; *cp; cp++)
  417. X        switch (*cp) {
  418. X            case '(':
  419. X            case ')':
  420. X            case '\\':
  421. X                yyoutput('\\');
  422. X            default:
  423. X                yyoutput(*cp);
  424. X        }
  425. X}
  426. X
  427. X/*
  428. X * Terminate a string output sequence.
  429. X */
  430. Xsput()
  431. X{
  432. X    if (bdone == 0)
  433. X        return;
  434. X    fprintf(yyout, ") %c s ", *font);
  435. X    bdone = 0;
  436. X}
  437. X
  438. X/*
  439. X * Output a string of tabs, newlines or formfeeds.
  440. X */
  441. Xspace(s)
  442. Xregister char *s;
  443. X{
  444. X    register n, prev;
  445. X    char *fmt;
  446. X
  447. X    while (*s) {
  448. X        for (prev = *s, n = 0; prev == *s; s++, n++)
  449. X            ;
  450. X        switch (prev) {
  451. X            case '\t':
  452. X                fmt = "%d t\t";
  453. X                break;
  454. X            case '\n':
  455. X                fmt = "%d n\n";
  456. X                break;
  457. X            case '\f':
  458. X                fmt = "%d f\n";
  459. X                break;
  460. X        }
  461. X        sput();
  462. X        fprintf(yyout, fmt, n);
  463. X    }
  464. X}
  465. X
  466. X/*
  467. X * Print a subtitle.
  468. X */
  469. Xfunct(s)
  470. Xregister char *s;
  471. X{
  472. X    if (!*s)
  473. X        return;
  474. X    sput();
  475. X    echo(s);
  476. X    fprintf(yyout, ") funct\n", s);
  477. X    bdone = 0;
  478. X}
  479. X/*
  480. X * Is s a keyword?
  481. X */
  482. Xiskw(s)
  483. Xregister char *s;
  484. X{
  485. X    register char **kw;
  486. X
  487. X    for (kw = &keywords[1]; *kw; kw++) {
  488. X        register char *kp = *kw;
  489. X        register char *sp = s;
  490. X
  491. X        while (*kp == *sp++)
  492. X            if (*kp++ == '\0')
  493. X                return(kw - keywords);
  494. X    }
  495. X    return(0);
  496. X}
  497. X
  498. X/*
  499. X * Given a file descriptor, print its modification date.
  500. X */
  501. Xvoid
  502. Xfdate(fd)
  503. Xint fd;
  504. X{
  505. X    struct stat st;
  506. X    register char *cp;
  507. X    extern char *ctime();
  508. X
  509. X    if (fstat(fd, &st) < 0 || (st.st_mode & S_IFMT) != S_IFREG)
  510. X        time(&st.st_mtime);
  511. X    cp = ctime(&st.st_mtime);
  512. X    strcpy(&cp[16], &cp[19]);
  513. X    fprintf(yyout, "(%.17s) fdate\n", &cp[4]);
  514. X}
  515. X
  516. X/*
  517. X * yyelx() each input file.
  518. X */
  519. Xmain(argc, argv)
  520. Xchar **argv;
  521. X{
  522. X    int i;
  523. X
  524. X    if (argc == 1) {
  525. X        fdate(fileno(yyin = stdin));
  526. X        fprintf(yyout, "() fname\n");
  527. X        yylex();
  528. X        sput();
  529. X    }
  530. X    for (i = 1; i < argc; i++) {
  531. X        if (*argv[i] == '-') {
  532. X            yyin = stdin;
  533. X            *argv[i] = '\0';
  534. X        } else if ((yyin = fopen(argv[i], "r")) == NULL) {
  535. X            perror(argv[i]);
  536. X            continue;
  537. X        }
  538. X
  539. X        fdate(fileno(yyin));
  540. X        fprintf(yyout, "(%s) fname\n", argv[i]);
  541. X        yylex();
  542. X        sput();
  543. X        if (yyin != stdin)
  544. X            fclose(yyin);
  545. X    }
  546. X    exit(0);
  547. X}
  548. SHAR_EOF
  549. if test 2824 -ne "`wc -c < 'lind.c'`"
  550. then
  551.     echo shar: "error transmitting 'lind.c'" '(should have been 2824 characters)'
  552. fi
  553. fi
  554. echo shar: "extracting 'prc.c'" '(1972 characters)'
  555. if test -f 'prc.c'
  556. then
  557.     echo shar: "will not over-write existing file 'prc.c'"
  558. else
  559. sed 's/^X//' << \SHAR_EOF > 'prc.c'
  560. X#include <stdio.h>
  561. X
  562. Xchar    *wd = "prc";
  563. Xstruct prc {
  564. X    int page;
  565. X    int row;
  566. X    int col;
  567. X};
  568. X
  569. Xstruct prc zero, max;
  570. Xint tab = 8;
  571. X
  572. Xmain(argc, argv)
  573. Xchar **argv;
  574. X{
  575. X    int i;
  576. X    register FILE *fp;
  577. X
  578. X    while (argc > 1 && *argv[1] == '-') {
  579. X        switch (argv[1][1]) {
  580. X        case 'p':
  581. X        case 'r':
  582. X        case 'c': 
  583. X            wd = argv[1]+1;
  584. X            break;
  585. X        case 't':
  586. X            if (tab = atoi(&argv[1][2]))
  587. X                break;
  588. X            argc--;
  589. X            argv++;
  590. X            tab = atoi(argv[1]);
  591. X            break;
  592. X        default:
  593. X            fprintf(stderr,
  594. X                "Usage: prc [-prc] [-t tab] [files]\n");
  595. X            exit(1);
  596. X        }
  597. X        argc--;
  598. X        argv++;
  599. X    }
  600. X
  601. X    i = 1;
  602. X    fp = stdin;
  603. X
  604. X    do {
  605. X        if (argc > 1 && (fp = fopen(argv[i], "r")) == NULL) {
  606. X            perror(argv[i]);
  607. X            continue;
  608. X        }
  609. X        prc1(fp);
  610. X        if (argc > 2)
  611. X            printf(" %s", argv[i]);
  612. X        putchar('\n');
  613. X        fclose(fp);
  614. X    } while(++i < argc);
  615. X
  616. X    if (argc > 2) {
  617. X        prprc(&max);
  618. X        printf(" maximum\n");
  619. X    }
  620. X    exit(0);
  621. X}
  622. X
  623. X#define MAX(A, B)    ((A) > (B) ? (A) : (B))
  624. X#define ROUND(A, B)    ((A + B) / (B) * (B))
  625. X
  626. Xprprc(prcp)
  627. Xstruct prc *prcp;
  628. X{
  629. X    register char *wdp = wd;
  630. X
  631. X    while (*wdp) switch (*wdp++) {
  632. X    case 'p':
  633. X        ipr(prcp->page);
  634. X        break;
  635. X
  636. X    case 'r':
  637. X        ipr(prcp->row);
  638. X        break;
  639. X
  640. X    case 'c':
  641. X        ipr(prcp->col);
  642. X        break;
  643. X
  644. X    }
  645. X}
  646. X
  647. Xipr(num)
  648. Xint num;
  649. X{
  650. X    printf(" %7d", num);
  651. X}
  652. X
  653. Xprc1(fp)
  654. XFILE *fp;
  655. X{
  656. X    register int c;
  657. X    struct prc cur;
  658. X    struct prc fil;
  659. X
  660. X    cur = zero;
  661. X    fil = zero;
  662. X    if ((c = getc(fp)) == EOF) {
  663. X        prprc(&fil);
  664. X        return;
  665. X    }
  666. X    ungetc(c, fp);
  667. X
  668. X    while ((c = getc(fp)) != EOF) {
  669. X        switch (c) {
  670. X            case '\b':
  671. X                if (cur.col > 0)
  672. X                    cur.col--;
  673. X                break;
  674. X            case '\f':
  675. X                cur.page++;
  676. X                fil.row = MAX(cur.row, fil.row);
  677. X                cur.row = -1;
  678. X            case '\n':
  679. X                cur.row++;
  680. X                fil.col = MAX(cur.col, fil.col);
  681. X                cur.col = 0;
  682. X                break;
  683. X            case '\t':
  684. X                cur.col = ROUND(cur.col, tab);
  685. X                break;
  686. X            default:
  687. X                cur.col++;
  688. X                break;
  689. X        };
  690. X    }
  691. X
  692. X    fil.col = MAX(cur.col, fil.col);
  693. X    fil.row = MAX(cur.row, fil.row);
  694. X    fil.page = cur.page + 1;
  695. X
  696. X    prprc(&fil);
  697. X
  698. X    max.page = MAX(fil.page, max.page);
  699. X    max.row = MAX(fil.row, max.row);
  700. X    max.col = MAX(fil.col, max.col);
  701. X}
  702. SHAR_EOF
  703. if test 1972 -ne "`wc -c < 'prc.c'`"
  704. then
  705.     echo shar: "error transmitting 'prc.c'" '(should have been 1972 characters)'
  706. fi
  707. fi
  708. echo shar: "extracting 'text.c'" '(1829 characters)'
  709. if test -f 'text.c'
  710. then
  711.     echo shar: "will not over-write existing file 'text.c'"
  712. else
  713. sed 's/^X//' << \SHAR_EOF > 'text.c'
  714. X#ifndef lint
  715. Xstatic char rcsid[] = "$Header: text.c,v 0.0 88/06/22 05:22:51 on Rel $";
  716. X#endif
  717. X#include <stdio.h>
  718. X#include <ctype.h>
  719. X#include "pps.h"
  720. X/*
  721. X * "Lexical analizer" for plain text (e.g. the output of nroff(1)):
  722. X * Prints _\b. and .\b_ in italics; c\bc in bold.
  723. X */
  724. XFILE *yyin = stdin;
  725. XFILE *yyout = stdout;
  726. Xchar *keywords[1];
  727. X
  728. Xstatic
  729. Xstruct ca {
  730. X    char c;        /* character to print */
  731. X    char a;        /* font to use */
  732. X} ca[BUFSIZ];
  733. X
  734. X#define ITALIC    'S'
  735. X#define NORM    'I'
  736. X#define BOLD    'K'
  737. X
  738. X/*
  739. X * Add character c at position cap.
  740. X */
  741. Xstatic
  742. Xcaput(c, cap)
  743. Xregister c;
  744. Xregister struct ca *cap;
  745. X{
  746. X    switch (cap->c) {
  747. X        case '_':
  748. X            cap->a = ITALIC;
  749. X            break;
  750. X        case '\0':
  751. X        case ' ':
  752. X            cap->a = NORM;
  753. X            break;
  754. X        default:
  755. X            switch (c) {
  756. X                case '_':
  757. X                    cap->a = ITALIC;
  758. X                    return;
  759. X                default:
  760. X                    if (cap->c == c)
  761. X                        cap->a = BOLD;
  762. X                case ' ':
  763. X                    break;
  764. X            }
  765. X    }
  766. X    cap->c = c;
  767. X}
  768. X
  769. X/*
  770. X * Print text collected so far.
  771. X */
  772. Xstatic
  773. Xcaflush(caend)
  774. Xstruct ca *caend;
  775. X{
  776. X    char buf[BUFSIZ];
  777. X    register struct ca *cap;
  778. X    static struct ca zeroca;
  779. X
  780. X    for (cap = ca; cap < caend;) {
  781. X        register char *cp = buf;
  782. X
  783. X        while (cap < caend && cap->a == *font) {
  784. X            *cp++ = cap->c;
  785. X            *cap++ = zeroca;
  786. X        }
  787. X        *cp = '\0';
  788. X        echo(buf);
  789. X        sput();
  790. X        if (cap->a)
  791. X            *font = cap->a;
  792. X    }
  793. X}
  794. X
  795. X/*
  796. X * Process input text:
  797. X *    Call space() for [\t\n\f],
  798. X *    Save others in ca.
  799. X */
  800. Xyylex()
  801. X{
  802. X    register struct ca *cap = ca;
  803. X    static char sp[2];
  804. X
  805. X    for (;;) {
  806. X        register c;
  807. X
  808. X        while (isprint(c = getc(yyin)) || c == ' ')
  809. X            caput(c, cap++);
  810. X        
  811. X        switch (c) {
  812. X            default:
  813. X                continue;
  814. X            case '\b':
  815. X                if (cap > ca)
  816. X                    cap--;
  817. X                continue;
  818. X            case '\r':    /* BUG -- won't work after \t */
  819. X                cap = ca;
  820. X                continue;
  821. X            case '\t':
  822. X            case '\n':
  823. X            case '\f':
  824. X            case EOF:
  825. X                break;
  826. X        }
  827. X        caflush(cap);
  828. X        cap = ca;
  829. X        if (c == EOF)
  830. X            return;
  831. X        *sp = c;
  832. X        space(sp);
  833. X    }
  834. X}
  835. SHAR_EOF
  836. if test 1829 -ne "`wc -c < 'text.c'`"
  837. then
  838.     echo shar: "error transmitting 'text.c'" '(should have been 1829 characters)'
  839. fi
  840. fi
  841. echo shar: "extracting 'awk.l'" '(1238 characters)'
  842. if test -f 'awk.l'
  843. then
  844.     echo shar: "will not over-write existing file 'awk.l'"
  845. else
  846. sed 's/^X//' << \SHAR_EOF > 'awk.l'
  847. X%{
  848. X#ifndef lint
  849. Xstatic char rcsid[] = "$Header: awk.l,v 0.0 88/06/22 05:21:58 on Rel $";
  850. X#endif
  851. X#include "pps.h"
  852. X#include <ctype.h>
  853. X
  854. Xint nbrace;
  855. X%}
  856. Xletter    [A-Za-z_]
  857. Xdigit    [0-9]
  858. Xwhite    [ \t]
  859. X%Start COMMENT STRING1 STRING2 KEYWORD
  860. X%%
  861. X<INITIAL>{letter}({letter}|{digit})*/{white}*:    {
  862. X            funct(yytext);
  863. X            REJECT;
  864. X        }
  865. X<INITIAL>{letter}({letter}|{digit})*    {
  866. X            int kw = iskw(yytext);
  867. X            if (kw)
  868. X                begin(KEYWORD);
  869. X            ECHO;
  870. X            if (kw)
  871. X                begin(INITIAL);
  872. X        }
  873. X<INITIAL>\"    { ECHO; begin(STRING1); }
  874. X<STRING1>\\.    { ECHO; }
  875. X<STRING1>\"    { begin(INITIAL); ECHO; }
  876. X<INITIAL>~[ \t]*\/    { ECHO; begin(STRING2); }
  877. X<INITIAL>^[ \t]*\/    {
  878. X            if (!nbrace) {
  879. X                ECHO;
  880. X                begin(STRING2);
  881. X            } else
  882. X                REJECT;
  883. X        }
  884. X<STRING2>\\.    { ECHO; }
  885. X<STRING2>\/    { begin(INITIAL); ECHO; }
  886. X<INITIAL>\{    { ECHO; nbrace++; }
  887. X<INITIAL>\}    { ECHO; nbrace--; }
  888. X<INITIAL>#.*    { begin(COMMENT); ECHO; begin(INITIAL); }
  889. X[\t\n\f]+    { space(yytext); }
  890. X.        { ECHO; }
  891. X%%
  892. Xchar *keywords[] = {
  893. X    "",
  894. X    "BEGIN",
  895. X    "END",
  896. X    "FILENAME",
  897. X    "FS",
  898. X    "NF",
  899. X    "NR",
  900. X    "OFMT",
  901. X    "OFS",
  902. X    "ORS",
  903. X    "RS",
  904. X    "break",
  905. X    "continue",
  906. X    "else",
  907. X    "exit",
  908. X    "exp",
  909. X    "for",
  910. X    "getline",
  911. X    "if",
  912. X    "in",
  913. X    "int",
  914. X    "index",
  915. X    "length",
  916. X    "log",
  917. X    "next",
  918. X    "print",
  919. X    "printf",
  920. X    "split",
  921. X    "sprintf",
  922. X    "sqrt",
  923. X    "substr",
  924. X    "while",
  925. X    NULL
  926. X};
  927. SHAR_EOF
  928. if test 1238 -ne "`wc -c < 'awk.l'`"
  929. then
  930.     echo shar: "error transmitting 'awk.l'" '(should have been 1238 characters)'
  931. fi
  932. fi
  933. echo shar: "extracting 'c.l'" '(1411 characters)'
  934. if test -f 'c.l'
  935. then
  936.     echo shar: "will not over-write existing file 'c.l'"
  937. else
  938. sed 's/^X//' << \SHAR_EOF > 'c.l'
  939. X%{
  940. X#ifndef lint
  941. Xstatic char rcsid[] = "$Header: c.l,v 0.0 88/06/22 05:22:01 on Rel $";
  942. X#endif
  943. X#include "pps.h"
  944. X#include <ctype.h>
  945. X
  946. Xint nbrace;
  947. X%}
  948. Xletter    [A-Za-z_]
  949. Xdigit    [0-9]
  950. Xwhite    [ \t]
  951. X%Start COMMENT STRING1 STRING2 KEYWORD
  952. X%%
  953. X<INITIAL>^{white}*{letter}({letter}|{digit})*/{white}*\(    {
  954. X            register char *cp = yytext;
  955. X            if (nbrace == 0) {
  956. X                while (isspace(*cp++))
  957. X                    ;
  958. X                funct(--cp);
  959. X            }
  960. X            REJECT;
  961. X        }
  962. X<INITIAL>{letter}({letter}|{digit})*    {
  963. X            int kw = iskw(yytext);
  964. X            if (kw)
  965. X                begin(KEYWORD);
  966. X            ECHO;
  967. X            if (kw)
  968. X                begin(INITIAL);
  969. X        }
  970. X<INITIAL>\"    { begin(STRING1); ECHO; }
  971. X<INITIAL>\'    { begin(STRING2); ECHO; }
  972. X<INITIAL>\/\*    { begin(COMMENT); ECHO; }
  973. X<STRING1>\\.    { ECHO; }
  974. X<STRING2>\\.    { ECHO; }
  975. X<STRING1>\"    { ECHO; begin(INITIAL); }
  976. X<STRING2>\'    { ECHO; begin(INITIAL); }
  977. X<COMMENT>\*\/    { ECHO; begin(INITIAL); }
  978. X[\t\n\f]+    { space(yytext); }
  979. X<INITIAL>\{    { nbrace++; REJECT; }
  980. X<INITIAL>\}    { nbrace--; REJECT; }
  981. X.        { ECHO; }
  982. X%%
  983. X/*
  984. X * This should better be sorted by frequency.
  985. X */
  986. Xchar *keywords[] = {
  987. X    "   ",
  988. X    "asm",
  989. X    "auto",
  990. X    "break",
  991. X    "case",
  992. X    "char",
  993. X    "continue",
  994. X    "default",
  995. X    "define",
  996. X    "do",
  997. X    "double",
  998. X    "else",
  999. X    "endif",
  1000. X    "enum",
  1001. X    "extern",
  1002. X    "float",
  1003. X    "for",
  1004. X    "fortran",
  1005. X    "goto",
  1006. X    "if",
  1007. X    "ifdef",
  1008. X    "ifndef",
  1009. X    "include",
  1010. X    "int",
  1011. X    "long",
  1012. X    "register",
  1013. X    "return",
  1014. X    "short",
  1015. X    "sizeof",
  1016. X    "static",
  1017. X    "struct",
  1018. X    "switch",
  1019. X    "typedef",
  1020. X    "undef",
  1021. X    "union",
  1022. X    "unsigned",
  1023. X    "void", 
  1024. X    "while",
  1025. X    NULL
  1026. X};
  1027. SHAR_EOF
  1028. if test 1411 -ne "`wc -c < 'c.l'`"
  1029. then
  1030.     echo shar: "error transmitting 'c.l'" '(should have been 1411 characters)'
  1031. fi
  1032. fi
  1033. echo shar: "extracting 'csh.l'" '(1574 characters)'
  1034. if test -f 'csh.l'
  1035. then
  1036.     echo shar: "will not over-write existing file 'csh.l'"
  1037. else
  1038. sed 's/^X//' << \SHAR_EOF > 'csh.l'
  1039. X%{
  1040. X#ifndef lint
  1041. Xstatic char rcsid[] = "$Header: csh.l,v 0.0 88/06/22 05:22:04 on Rel $";
  1042. X#endif
  1043. X#include "pps.h"
  1044. X#include <ctype.h>
  1045. X
  1046. Xint nbrace;
  1047. X%}
  1048. Xletter    [A-Za-z_]
  1049. Xdigit    [0-9]
  1050. Xwhite    [ \t]
  1051. Xbuiltin    [\$\<\*0-9]
  1052. X%Start COMMENT STRING1 STRING2 KEYWORD
  1053. X%%
  1054. X<INITIAL>{letter}({letter}|{digit})*/{white}*:    {
  1055. X            funct(yytext);
  1056. X            REJECT;
  1057. X        }
  1058. X<INITIAL>{letter}({letter}|{digit})*    {
  1059. X            int kw = iskw(yytext);
  1060. X            if (kw)
  1061. X                begin(KEYWORD);
  1062. X            ECHO;
  1063. X            if (kw)
  1064. X                begin(INITIAL);
  1065. X        }
  1066. X<INITIAL>\"    { begin(STRING1); ECHO; }
  1067. X<INITIAL>\'    { begin(STRING2); ECHO; }
  1068. X<INITIAL>#.*    { begin(COMMENT); ECHO; begin(INITIAL); }
  1069. X<STRING1>\\.    { ECHO; }
  1070. X<STRING2>\\.    { ECHO; }
  1071. X<STRING1>\"    { ECHO; begin(INITIAL); }
  1072. X<STRING2>\'    { ECHO; begin(INITIAL); }
  1073. X<INITIAL>\${builtin}    { begin(KEYWORD); ECHO; begin(INITIAL); }
  1074. X<STRING1>\${builtin}    { begin(KEYWORD); ECHO; begin(STRING1); }
  1075. X<INITIAL>\$    { begin(KEYWORD); ECHO; begin(INITIAL); }
  1076. X<STRING1>\$    { begin(KEYWORD); ECHO; begin(STRING1); }
  1077. X[\t\n\f]+    { space(yytext); }
  1078. X.        { ECHO; }
  1079. X%%
  1080. Xchar *keywords[] = {
  1081. X    "",
  1082. X    "alias",
  1083. X    "alloc",
  1084. X    "break",
  1085. X    "breaksw",
  1086. X    "case",
  1087. X    "cd",
  1088. X    "chdir",
  1089. X    "continue",
  1090. X    "default",
  1091. X    "echo",
  1092. X    "else",
  1093. X    "end",
  1094. X    "endif",
  1095. X    "endsw",
  1096. X    "exec",
  1097. X    "exit",
  1098. X    "foreach",
  1099. X    "glob",
  1100. X    "goto",
  1101. X    "history",
  1102. X    "if",
  1103. X    "logout",
  1104. X    "nice",
  1105. X    "nohup",
  1106. X    "onintr",
  1107. X    "repeat",
  1108. X    "set",
  1109. X    "setenv",
  1110. X    "shift",
  1111. X    "source",
  1112. X    "switch",
  1113. X    "then",
  1114. X    "time",
  1115. X    "while",
  1116. X    "umask",
  1117. X    "unalias",
  1118. X    "unset",
  1119. X    "wait",
  1120. X    "while",
  1121. X    "@",
  1122. X    "env",
  1123. X    "argv",
  1124. X    "child",
  1125. X    "home",
  1126. X    "ignoreeof",
  1127. X    "noclobber",
  1128. X    "noglob",
  1129. X    "nomatch",
  1130. X    "path",
  1131. X    "prompt",
  1132. X    "shell",
  1133. X    "status",
  1134. X    "verbose",
  1135. X    NULL
  1136. X};
  1137. SHAR_EOF
  1138. if test 1574 -ne "`wc -c < 'csh.l'`"
  1139. then
  1140.     echo shar: "error transmitting 'csh.l'" '(should have been 1574 characters)'
  1141. fi
  1142. fi
  1143. echo shar: "extracting 'lisp.l'" '(938 characters)'
  1144. if test -f 'lisp.l'
  1145. then
  1146.     echo shar: "will not over-write existing file 'lisp.l'"
  1147. else
  1148. sed 's/^X//' << \SHAR_EOF > 'lisp.l'
  1149. X%{
  1150. X#ifndef lint
  1151. Xstatic char rcsid[] = "$Header: lisp.l,v 0.0 88/06/22 05:22:11 on Rel $";
  1152. X#endif
  1153. X#include <ctype.h>
  1154. X#include "pps.h"
  1155. X
  1156. Xint def;
  1157. X%}
  1158. Xletter    [@A-Za-z_\-:\$]
  1159. Xdigit    [0-9]
  1160. Xwhite    [ \t]
  1161. X%Start COMMENT STRING1 STRING2 KEYWORD
  1162. X%%
  1163. X<INITIAL>c[ad]+r    { begin(KEYWORD); ECHO; begin(INITIAL); }
  1164. X<INITIAL>def    { def++; REJECT; }
  1165. X<INITIAL>{letter}({letter}|{digit})*    {    /* BUG */
  1166. X            int kw = iskw(yytext);
  1167. X
  1168. X            if (kw)
  1169. X                begin(KEYWORD);
  1170. X            else if (def) {
  1171. X                funct(yytext);
  1172. X                def = 0;
  1173. X            }
  1174. X            ECHO;
  1175. X            if (kw)
  1176. X                begin(INITIAL);
  1177. X        }
  1178. X<INITIAL>\"    { begin(STRING1); ECHO; }
  1179. X<INITIAL>\#    { begin(COMMENT); ECHO; begin(INITIAL); }
  1180. X<INITIAL>;    { begin(COMMENT); ECHO; begin(INITIAL); }
  1181. X<STRING1>\\.    { ECHO; }
  1182. X<STRING1>\"    { ECHO; begin(INITIAL); }
  1183. X[\t\n\f]+    { space(yytext); }
  1184. X.        { ECHO; }
  1185. X%%
  1186. X/*
  1187. X * Your pet lisp dialect has other built-ins than ours;
  1188. X * anyway, the list is too long to ship over the net...
  1189. X */
  1190. Xchar *keywords[] = {
  1191. X    "",
  1192. X    NULL
  1193. X};
  1194. SHAR_EOF
  1195. if test 938 -ne "`wc -c < 'lisp.l'`"
  1196. then
  1197.     echo shar: "error transmitting 'lisp.l'" '(should have been 938 characters)'
  1198. fi
  1199. fi
  1200. echo shar: "extracting 'mail.l'" '(476 characters)'
  1201. if test -f 'mail.l'
  1202. then
  1203.     echo shar: "will not over-write existing file 'mail.l'"
  1204. else
  1205. sed 's/^X//' << \SHAR_EOF > 'mail.l'
  1206. X%{
  1207. X#ifndef lint
  1208. Xstatic char rcsid[] = "$Header: mail.l,v 0.0 88/06/22 05:22:14 on Rel $";
  1209. X#endif
  1210. X#include "pps.h"
  1211. X#define KEYWORD INITIAL
  1212. X%}
  1213. Xfield    ^[^ \t:]+:
  1214. X%Start COMMENT
  1215. X%%
  1216. X<INITIAL>{field}    {
  1217. X            begin(KEYWORD);
  1218. X            ECHO;
  1219. X            if (!iskw(yytext))
  1220. X                begin(INITIAL);
  1221. X        }
  1222. X<INITIAL>\n\n+    { begin(COMMENT); REJECT; }
  1223. X<COMMENT>^From    { begin(INITIAL); REJECT; }
  1224. X[\t\n\f]+    { space(yytext); }
  1225. X.        { ECHO; }
  1226. X%%
  1227. Xchar *keywords[] = {
  1228. X    "",
  1229. X    "Date:",
  1230. X    "From:",
  1231. X    "Subject:",
  1232. X    "To:",
  1233. X    NULL
  1234. X};
  1235. SHAR_EOF
  1236. if test 476 -ne "`wc -c < 'mail.l'`"
  1237. then
  1238.     echo shar: "error transmitting 'mail.l'" '(should have been 476 characters)'
  1239. fi
  1240. fi
  1241. echo shar: "extracting 'ps.l'" '(3710 characters)'
  1242. if test -f 'ps.l'
  1243. then
  1244.     echo shar: "will not over-write existing file 'ps.l'"
  1245. else
  1246. sed 's/^X//' << \SHAR_EOF > 'ps.l'
  1247. X%{
  1248. X#ifndef lint
  1249. Xstatic char rcsid[] = "$Header: ps.l,v 0.0 88/06/22 05:22:35 on Rel $";
  1250. X#endif
  1251. X#include "pps.h"
  1252. X
  1253. Xint nbrace;
  1254. X%}
  1255. Xnonspecial    [^ \t\n\f()<>[\]/]
  1256. X%S STRING KEYWORD COMMENT
  1257. X%%
  1258. X<INITIAL>^\/{nonspecial}+/[ \t]*\{    {
  1259. X            funct(yytext + 1);
  1260. X            REJECT;
  1261. X        }
  1262. X<INITIAL>{nonspecial}+    {
  1263. X            int kw = iskw(yytext);
  1264. X            if (kw)
  1265. X                begin(KEYWORD);
  1266. X            ECHO;
  1267. X            if (kw)
  1268. X                begin(INITIAL);
  1269. X        }
  1270. X<INITIAL>\(    { begin(STRING); ECHO; }
  1271. X<STRING>\\.    { ECHO; }
  1272. X<STRING>\)    { ECHO; begin(INITIAL); }
  1273. X<INITIAL>%.*    { begin(COMMENT); ECHO; begin(INITIAL); }
  1274. X[\t\n\f]+    { space(yytext); }
  1275. X.        { ECHO; }
  1276. X%%
  1277. Xchar *keywords[] = {
  1278. X    "",
  1279. X    "=",
  1280. X    "==",
  1281. X    "VMerror",
  1282. X    "[",
  1283. X    "]",
  1284. X    "abs",
  1285. X    "add",
  1286. X    "aload",
  1287. X    "anchorsearch",
  1288. X    "and",
  1289. X    "arc",
  1290. X    "arcn",
  1291. X    "arcto",
  1292. X    "array",
  1293. X    "ashow",
  1294. X    "astore",
  1295. X    "atan",
  1296. X    "awidthshow",
  1297. X    "bitshift",
  1298. X    "bytesavailable",
  1299. X    "cachestatus",
  1300. X    "ceiling",
  1301. X    "charpath",
  1302. X    "clear",
  1303. X    "cleartomark",
  1304. X    "clip",
  1305. X    "clippath",
  1306. X    "closefile",
  1307. X    "closepath",
  1308. X    "concat",
  1309. X    "concatmatrix",
  1310. X    "copy",
  1311. X    "copypage",
  1312. X    "cos",
  1313. X    "count",
  1314. X    "countdictstack",
  1315. X    "countexecstack",
  1316. X    "counttomark",
  1317. X    "currentcacheparams",
  1318. X    "currentdash",
  1319. X    "currentfile",
  1320. X    "currentflat",
  1321. X    "currentfont",
  1322. X    "currentgray",
  1323. X    "currenthsbcolor",
  1324. X    "currentlinecap",
  1325. X    "currentlinejoin",
  1326. X    "currentlinewidth",
  1327. X    "currentmatrix",
  1328. X    "currentmiterlimit",
  1329. X    "currentpacking",
  1330. X    "currentpoint",
  1331. X    "currentrgbcolor",
  1332. X    "currentscreen",
  1333. X    "currenttransfer",
  1334. X    "curveto",
  1335. X    "cvi",
  1336. X    "cvlit",
  1337. X    "cvn",
  1338. X    "cvr",
  1339. X    "cvrs",
  1340. X    "cvs",
  1341. X    "cvx",
  1342. X    "def",
  1343. X    "defaultmatrix",
  1344. X    "definefont",
  1345. X    "dict",
  1346. X    "dictfull",
  1347. X    "dictstack",
  1348. X    "dictstackoverflow",
  1349. X    "dictstackunderflow",
  1350. X    "div",
  1351. X    "dtransform",
  1352. X    "dup",
  1353. X    "echo",
  1354. X    "eoclip",
  1355. X    "eofill",
  1356. X    "eq",
  1357. X    "erasepage",
  1358. X    "exch",
  1359. X    "exec",
  1360. X    "execstack",
  1361. X    "execstackoverflow",
  1362. X    "executeonly",
  1363. X    "exit",
  1364. X    "exp",
  1365. X    "false",
  1366. X    "file",
  1367. X    "fill",
  1368. X    "findfont",
  1369. X    "flattenpath",
  1370. X    "floor",
  1371. X    "flush",
  1372. X    "flushfile",
  1373. X    "for",
  1374. X    "forall",
  1375. X    "framedevice",
  1376. X    "ge",
  1377. X    "get",
  1378. X    "getinterval",
  1379. X    "grestore",
  1380. X    "grestoreall",
  1381. X    "gsave",
  1382. X    "gt",
  1383. X    "identmatrix",
  1384. X    "idiv",
  1385. X    "idtransform",
  1386. X    "if",
  1387. X    "ifelse",
  1388. X    "image",
  1389. X    "imagemask",
  1390. X    "index",
  1391. X    "initclip",
  1392. X    "initgraphics",
  1393. X    "initmatrix",
  1394. X    "interrupt",
  1395. X    "invalidaccess",
  1396. X    "invalidexit",
  1397. X    "invalidfileaccess",
  1398. X    "invalidfont",
  1399. X    "invalidrestore",
  1400. X    "invertmatrix",
  1401. X    "ioerror",
  1402. X    "itransform",
  1403. X    "known",
  1404. X    "kshow",
  1405. X    "le",
  1406. X    "limitcheck",
  1407. X    "lineto",
  1408. X    "ln",
  1409. X    "load",
  1410. X    "log",
  1411. X    "loop",
  1412. X    "lt",
  1413. X    "makefont",
  1414. X    "mark",
  1415. X    "matrix",
  1416. X    "maxlength",
  1417. X    "mod",
  1418. X    "moveto",
  1419. X    "mul",
  1420. X    "ne",
  1421. X    "neg",
  1422. X    "newpath",
  1423. X    "nocurrentpoint",
  1424. X    "not",
  1425. X    "null",
  1426. X    "nulldevice",
  1427. X    "or",
  1428. X    "packedarray",
  1429. X    "pathbbox",
  1430. X    "pathforall",
  1431. X    "pop",
  1432. X    "print",
  1433. X    "prompt",
  1434. X    "pstack",
  1435. X    "put",
  1436. X    "putinterval",
  1437. X    "quit",
  1438. X    "rand",
  1439. X    "rangecheck",
  1440. X    "rcheck",
  1441. X    "rcurveto",
  1442. X    "read",
  1443. X    "readhexstring",
  1444. X    "readline",
  1445. X    "readonly",
  1446. X    "readstring",
  1447. X    "repeat",
  1448. X    "restore",
  1449. X    "reversepath",
  1450. X    "rlineto",
  1451. X    "rmoveto",
  1452. X    "roll",
  1453. X    "rotate",
  1454. X    "round",
  1455. X    "rrand",
  1456. X    "run",
  1457. X    "save",
  1458. X    "scale",
  1459. X    "scalefont",
  1460. X    "search",
  1461. X    "setcachedevice",
  1462. X    "setcachelimit",
  1463. X    "setcacheparams",
  1464. X    "setcharwidth",
  1465. X    "setdash",
  1466. X    "setflat",
  1467. X    "setfont",
  1468. X    "setgray",
  1469. X    "sethsbcolor",
  1470. X    "setlinecap",
  1471. X    "setlinejoin",
  1472. X    "setlinewidth",
  1473. X    "setmatrix",
  1474. X    "setmitrlimit",
  1475. X    "setpacking",
  1476. X    "setrgbcolor",
  1477. X    "setscreen",
  1478. X    "settransfer",
  1479. X    "show",
  1480. X    "showpage",
  1481. X    "sin",
  1482. X    "sqrt",
  1483. X    "srand",
  1484. X    "stack",
  1485. X    "stackoverflow",
  1486. X    "stackunderflow",
  1487. X    "start",
  1488. X    "status",
  1489. X    "stop",
  1490. X    "stopped",
  1491. X    "store",
  1492. X    "string",
  1493. X    "stringwidth",
  1494. X    "stroke",
  1495. X    "strokepath",
  1496. X    "sub",
  1497. X    "syntaxerror",
  1498. X    "systemdict",
  1499. X    "token",
  1500. X    "transform",
  1501. X    "translate",
  1502. X    "true",
  1503. X    "truncate",
  1504. X    "type",
  1505. X    "typecheck",
  1506. X    "undefined",
  1507. X    "undefinedfilename",
  1508. X    "undefinedresult",
  1509. X    "unmatchedmark",
  1510. X    "unregistered",
  1511. X    "userdict",
  1512. X    "usertime",
  1513. X    "version",
  1514. X    "vmstatus",
  1515. X    "wcheck",
  1516. X    "where",
  1517. X    "widthshow",
  1518. X    "write",
  1519. X    "writehexstring",
  1520. X    "writestring",
  1521. X    "xcheck",
  1522. X    "xor",
  1523. X    NULL
  1524. X};
  1525. SHAR_EOF
  1526. if test 3710 -ne "`wc -c < 'ps.l'`"
  1527. then
  1528.     echo shar: "error transmitting 'ps.l'" '(should have been 3710 characters)'
  1529. fi
  1530. fi
  1531. echo shar: "extracting 'sh.l'" '(1261 characters)'
  1532. if test -f 'sh.l'
  1533. then
  1534.     echo shar: "will not over-write existing file 'sh.l'"
  1535. else
  1536. sed 's/^X//' << \SHAR_EOF > 'sh.l'
  1537. X%{
  1538. X#ifndef lint
  1539. Xstatic char rcsid[] = "$Header: sh.l,v 0.0 88/06/22 05:22:38 on Rel $";
  1540. X#endif
  1541. X#include <ctype.h>
  1542. X#include "pps.h"
  1543. X
  1544. Xint nbrace;
  1545. X%}
  1546. Xletter    [A-Za-z_]
  1547. Xdigit    [0-9]
  1548. Xwhite    [ \t]
  1549. Xbuiltin    [#\*@\-\?\$\!0-9]
  1550. X%Start COMMENT STRING1 STRING2 KEYWORD
  1551. X%%
  1552. X<INITIAL>{letter}({letter}|{digit})*    {
  1553. X            int kw = iskw(yytext);
  1554. X            if (kw)
  1555. X                begin(KEYWORD);
  1556. X            ECHO;
  1557. X            if (kw)
  1558. X                begin(INITIAL);
  1559. X        }
  1560. X<INITIAL>\"    { begin(STRING1); ECHO; }
  1561. X<INITIAL>\'    { begin(STRING2); ECHO; }
  1562. X<INITIAL>#.*    { begin(COMMENT); ECHO; begin(INITIAL); }
  1563. X<STRING1>\\.    { ECHO; }
  1564. X<STRING2>\\.    { ECHO; }
  1565. X<STRING1>\"    { ECHO; begin(INITIAL); }
  1566. X<STRING2>\'    { ECHO; begin(INITIAL); }
  1567. X<INITIAL>\${builtin}    { begin(KEYWORD); ECHO; begin(INITIAL); }
  1568. X<STRING1>\${builtin}    { begin(KEYWORD); ECHO; begin(STRING1); }
  1569. X<INITIAL>\$    { begin(KEYWORD); ECHO; begin(INITIAL); }
  1570. X<STRING1>\$    { begin(KEYWORD); ECHO; begin(STRING1); }
  1571. X[\t\n\f]+    { space(yytext); }
  1572. X.        { ECHO; }
  1573. X%%
  1574. Xchar *keywords[] = {
  1575. X    "",
  1576. X    "for",
  1577. X    "in",
  1578. X    "do",
  1579. X    "done",
  1580. X    "case",
  1581. X    "if",
  1582. X    "then",
  1583. X    "else",
  1584. X    "elif",
  1585. X    "fi",
  1586. X    "while",
  1587. X    "break",
  1588. X    "cd",
  1589. X    "chdir",
  1590. X    "continue",
  1591. X    "eval",
  1592. X    "exec",
  1593. X    "exit",
  1594. X    "export",
  1595. X    "read",
  1596. X    "readonly",
  1597. X    "set",
  1598. X    "shift",
  1599. X    "times",
  1600. X    "trap",
  1601. X    "umsak",
  1602. X    "wait",
  1603. X    "HOME",
  1604. X    "IFS",
  1605. X    "MAIL",
  1606. X    "PATH",
  1607. X    "PS1",
  1608. X    "PS2",
  1609. X    NULL
  1610. X};
  1611. SHAR_EOF
  1612. if test 1261 -ne "`wc -c < 'sh.l'`"
  1613. then
  1614.     echo shar: "error transmitting 'sh.l'" '(should have been 1261 characters)'
  1615. fi
  1616. fi
  1617. echo shar: "extracting 'pps.sh'" '(1515 characters)'
  1618. if test -f 'pps.sh'
  1619. then
  1620.     echo shar: "will not over-write existing file 'pps.sh'"
  1621. else
  1622. sed 's/^X//' << \SHAR_EOF > 'pps.sh'
  1623. Xrcsid='$Header: pps.sh,v 0.0 88/06/22 05:22:29 on Rel $'
  1624. X#
  1625. X# Argument processor and handshaker for C to postscript pretty printer
  1626. X#
  1627. Xlib=.
  1628. Xusage="Usage: $0 [-C font] [-h heder] [-l lang] [-t tabs] [-v pitch] [files]"
  1629. Xinit=ppsinit
  1630. Xwhile [ x"$*" != x ]
  1631. Xdo
  1632. X    case $1 in
  1633. X        -[ICSK])
  1634. X:            ${2?$usage}
  1635. X            if font=`grep -w -i $2 $lib/fonts`
  1636. X            then
  1637. X                font=`echo $font | sed 's/ .*//'`
  1638. X            else
  1639. X                echo ${0}: ${2}: Unknown font 1>&2
  1640. X                exit 17
  1641. X            fi
  1642. X            pos=`echo $1 | sed 's/-//'`
  1643. X            init="fonts /$pos /$font put $init"
  1644. X            shift
  1645. X            ;;
  1646. X        -h)
  1647. X:            ${2?$usage}
  1648. X            header=`echo "$2" | sed 's/[\\()]/\\\&/g'`
  1649. X            init="/header ($header) def $init"
  1650. X            shift
  1651. X            ;;
  1652. X        -l)
  1653. X:            ${2?$usage}
  1654. X            if [ ! -r $lib/$2 ]
  1655. X            then
  1656. X                echo ${0}: ${2}: Unknown language 1>&2
  1657. X                exit 17
  1658. X            fi
  1659. X            lang=$2
  1660. X            shift
  1661. X            ;;
  1662. X        -n)
  1663. X            init="/lineres ${2?$usage} def $init"
  1664. X            shift;
  1665. X            ;;
  1666. X        -p)
  1667. X            init="/progsize ${2?$usage} def $init"
  1668. X            shift;
  1669. X            ;;
  1670. X        -s)
  1671. X            if [ ! -r ${2?$usage} ]
  1672. X            then
  1673. X                echo ${0}: ${2} unreadable 1>&2
  1674. X                exit 17
  1675. X            fi
  1676. X            shift
  1677. X            ;;
  1678. X        -t)
  1679. X            init="/tabstop ${2?$usage} def $init"
  1680. X            shift;
  1681. X            ;;
  1682. X        -v)
  1683. X            init="/lpi ${2?$usage} def $init"
  1684. X            shift;
  1685. X            ;;
  1686. X        -?*)
  1687. X            echo $usage 1>&2
  1688. X            exit 19
  1689. X            ;;
  1690. X        *)
  1691. X            files="$files $1"
  1692. X            ;;
  1693. X    esac
  1694. X    shift
  1695. Xdone
  1696. X
  1697. Xcat - ${prog-$lib/pps.pro} $style << EOC
  1698. X%!PS-Adobe-1.0
  1699. X%%Title: ${files-standard input}
  1700. X%%Creator: $0 ($rcsid)
  1701. X%%CreationDate: `date`
  1702. X%%For: ${USER-unknown}@${HOST-`hostname || uuname -l`}
  1703. X%%EndComments
  1704. XEOC
  1705. Xecho $init && ${lib}/${lang=c} $files && echo "%%Trailer
  1706. Xppsdone"
  1707. SHAR_EOF
  1708. if test 1515 -ne "`wc -c < 'pps.sh'`"
  1709. then
  1710.     echo shar: "error transmitting 'pps.sh'" '(should have been 1515 characters)'
  1711. fi
  1712. chmod +x 'pps.sh'
  1713. fi
  1714. echo shar: "extracting 'slide.sh'" '(954 characters)'
  1715. if test -f 'slide.sh'
  1716. then
  1717.     echo shar: "will not over-write existing file 'slide.sh'"
  1718. else
  1719. sed 's/^X//' << \SHAR_EOF > 'slide.sh'
  1720. Xrcsid='$Header: slide.sh,v 0.0 88/06/22 05:22:48 on Rel $'
  1721. X#
  1722. X# Argument processor and handshaker for slide maker.
  1723. X#
  1724. Xusage="usage: ${0} [ -l language ] [ -t tabstop ] files"
  1725. Xlib=.
  1726. XPATH=/bin:/usr/bin
  1727. X
  1728. Xwhile [ "$*" ]
  1729. Xdo
  1730. X    case $1 in
  1731. X        -l)
  1732. X            if [ ! -r $lib/${2?$usage} ]
  1733. X            then
  1734. X                echo ${0}: ${2}: Unknown language 1>&2
  1735. X                exit 17
  1736. X            fi
  1737. X            lang=$2
  1738. X            shift
  1739. X            ;;
  1740. X        -t)
  1741. X            tab=${2?$usage} ; shift
  1742. X            ;;
  1743. X        -*)
  1744. X            echo $uasge 1>&2
  1745. X            exit 1
  1746. X            ;;
  1747. X        *)
  1748. X            files="$files $1"
  1749. X    esac
  1750. X    shift
  1751. Xdone
  1752. X
  1753. X# Sainity check
  1754. X: ${files?"Sorry, cannot read standard input."}
  1755. X: ${lang=c}
  1756. X: ${tab=8}
  1757. Xcolrow=`$lib/prc -cr -t $tab $files | sed -n '$s/[^0-9][^0-9]*/ /gp'`
  1758. X
  1759. Xcat - ${prog-$lib/slide.pro} $style << EOC
  1760. X%!PS-Adobe-1.0
  1761. X%%Title: ${files-standard input}
  1762. X%%Creator: $0 ($rcsid)
  1763. X%%CreationDate: `date`
  1764. X%%For: ${USER-unknown}@${HOST-`hostname || uuname -l`}
  1765. X%%EndComments
  1766. XEOC
  1767. Xecho "
  1768. X/tabstop $tab def
  1769. X$colrow ppsinit
  1770. X" && ${lib}/${lang=c} $files && echo "%%Trailer
  1771. Xppsdone"
  1772. SHAR_EOF
  1773. if test 954 -ne "`wc -c < 'slide.sh'`"
  1774. then
  1775.     echo shar: "error transmitting 'slide.sh'" '(should have been 954 characters)'
  1776. fi
  1777. chmod +x 'slide.sh'
  1778. fi
  1779. echo shar: "extracting 'pps.pro'" '(4116 characters)'
  1780. if test -f 'pps.pro'
  1781. then
  1782.     echo shar: "will not over-write existing file 'pps.pro'"
  1783. else
  1784. sed 's/^X//' << \SHAR_EOF > 'pps.pro'
  1785. X%%$Header: pps.pro,v 0.0 88/06/22 05:22:26 on Rel $
  1786. X
  1787. X% General macros ( should be builtins :-)
  1788. X
  1789. X/inch { 72 mul } def
  1790. X/min { 2 copy gt { exch } if pop } def
  1791. X/max { 2 copy lt { exch } if pop } def
  1792. X/curx { currentpoint pop } def
  1793. X/cury { currentpoint exch pop } def
  1794. X
  1795. X% Show a string, right justified, and move to its beginning.
  1796. X/rshow {    % string
  1797. X    dup stringwidth pop neg        % string width, negative
  1798. X    dup 0 rmoveto
  1799. X    exch show
  1800. X    0 rmoveto            % to beginning of string
  1801. X} def
  1802. X
  1803. X% Commands
  1804. X
  1805. X/fname {    % string fname -
  1806. X    /filename exch def
  1807. X    /pageno 0 def
  1808. X    /lineno 1 def
  1809. X    1 f
  1810. X} def
  1811. X
  1812. X/fdate {    % string fdate -
  1813. X    /date exch def
  1814. X} def
  1815. X
  1816. X/funct {    % string funct -
  1817. X    gsave
  1818. X    C titlesize scalefont setfont
  1819. X
  1820. X    fbase
  1821. X    dontstep ( ) stringwidth pop sub cury min
  1822. X    moveto
  1823. X    90 rotate
  1824. X    rshow
  1825. X    /dontstep curx ( ) stringwidth pop sub def    % Yech!
  1826. X
  1827. X    grestore
  1828. X} def
  1829. X
  1830. X/t {    % ntabs t -
  1831. X    { 
  1832. X        curx 1 add
  1833. X        tabwidth div ceiling
  1834. X        tabwidth mul
  1835. X        dup rlimit gt {
  1836. X            pop
  1837. X            lcont marshow
  1838. X            1 nl
  1839. X        } {
  1840. X            cury moveto
  1841. X        } ifelse
  1842. X    } repeat
  1843. X} def
  1844. X
  1845. X/nl {    % nlines nl -    (internal use)
  1846. X    {
  1847. X        cury dy add
  1848. X        dup
  1849. X        highth neg le {
  1850. X            pop
  1851. X            1 f
  1852. X        } {
  1853. X            0 exch
  1854. X            moveto
  1855. X        } ifelse
  1856. X    } repeat
  1857. X} def
  1858. X
  1859. X% Show a string in margins, if there is enough room.
  1860. X/marshow {    % string marshow -    (internal)
  1861. X    cury dight add dontstep lt {
  1862. X        gsave
  1863. X
  1864. X        C setfont
  1865. X        width cury moveto
  1866. X        rshow
  1867. X        /dontstep cury def
  1868. X
  1869. X        grestore
  1870. X    } if
  1871. X} def
  1872. X
  1873. X/n {    % nlines n -
  1874. X    dup lineno add
  1875. X    /lineno exch def
  1876. X
  1877. X    nl
  1878. X    % Bug: does not number blank lines!
  1879. X    lineres 0 gt {
  1880. X        lineno lineres mod 0 eq {
  1881. X            lineno maxline cvs marshow
  1882. X        } if
  1883. X    } if
  1884. X} def
  1885. X
  1886. X/np {    % npages np -    (internal)
  1887. X    totalpage 0 gt {
  1888. X        showpage
  1889. X    } if
  1890. X    /totalpage totalpage 1 add def
  1891. X    margin ury translate
  1892. X    0 0 moveto
  1893. X} def
  1894. X
  1895. X/f {    % npages f -
  1896. X    {
  1897. X        np
  1898. X        /pageno pageno 1 add def
  1899. X        titleput
  1900. X        pageno 1 gt {
  1901. X            lineno maxline cvs marshow
  1902. X        } if
  1903. X    } repeat
  1904. X} def
  1905. X    
  1906. X/s {    % string font s -
  1907. X    setfont
  1908. X
  1909. X    dup stringwidth pop
  1910. X    curx add
  1911. X    rlimit gt {
  1912. X        lcont marshow
  1913. X        1 nl
  1914. X    } if
  1915. X    show
  1916. X} def
  1917. X
  1918. X% This is a halfhearted attempt.
  1919. X% The ultimate thing is a printf() like specification from argv[].
  1920. X/titleput { % - titleput -
  1921. X    0 dy 3 mul rmoveto    % space for title
  1922. X
  1923. X    C setfont
  1924. X    date show
  1925. X
  1926. X    C titlesize scalefont setfont
  1927. X
  1928. X    width cury moveto
  1929. X    pageno maxpage cvs rshow
  1930. X
  1931. X    curx (  ) stringwidth pop sub rlimit min
  1932. X    cury moveto
  1933. X    currentdict /header known {
  1934. X        header
  1935. X    } {
  1936. X        filename
  1937. X    } ifelse rshow
  1938. X
  1939. X    /dontstep cury def
  1940. X    0 cury dy 2 mul add moveto
  1941. X} def
  1942. X
  1943. X% Init macro - must be called after definitions are changed.
  1944. X
  1945. X/ppsinit { % - ppsinit -
  1946. X    gsave
  1947. X
  1948. X    /dy     1 inch lpi div neg def
  1949. X    fonts {
  1950. X        findfont dy neg progsize mul scalefont def
  1951. X    } forall
  1952. X
  1953. X    % Paper limits
  1954. X    initclip clippath pathbbox
  1955. X    /ury exch def
  1956. X    /urx exch 5 sub def    % margin may be set wrong
  1957. X    /lly exch def
  1958. X    /llx exch def
  1959. X
  1960. X    % Line numbers are right justified to width.
  1961. X    % We force a newline when rlimit is exceeded by text.
  1962. X    /highth ury lly sub dy add def
  1963. X    /margin llx 1 inch add def
  1964. X    /width urx margin sub def
  1965. X
  1966. X    % UnderlinePosition or FontBBox may be missing...
  1967. X    % Measure sizes of things we print in margins.
  1968. X    C setfont
  1969. X    /rlimit width maxline stringwidth pop sub def    % right limit
  1970. X
  1971. X    newpath 0 0 moveto
  1972. X    (670) true charpath flattenpath pathbbox
  1973. X    /dight exch def                    % digit ht
  1974. X    pop pop pop
  1975. X
  1976. X    C titlesize scalefont setfont
  1977. X    newpath 0 0 moveto
  1978. X    (qypfgj\(\),_) true charpath flattenpath pathbbox
  1979. X    pop pop exch pop width add
  1980. X    /fbase exch def                    % function base
  1981. X
  1982. X    I setfont
  1983. X    /tabwidth (n) stringwidth pop tabstop mul def
  1984. X
  1985. X    /totalpage 0 def
  1986. X
  1987. X    grestore
  1988. X} def
  1989. X
  1990. X/ppsdone {
  1991. X    showpage
  1992. X} def
  1993. X
  1994. X% Page style -- may be modified.
  1995. X
  1996. X/tabstop 8 def      % Charcters per tabstop
  1997. X/lineres 10 def        % Line numbering resolution
  1998. X/maxline (9999) def    % Maximum lines / file
  1999. X/maxpage (999) def    % Maximum pages / file
  2000. X
  2001. X/lpi 7 def        % Lines per inch
  2002. X/progsize 70 72 div def    % Program point size / line spacing
  2003. X/titlesize 1.2 def    % Title point size / program point size
  2004. X
  2005. X% Default fonts -- need not be fixed pitch.
  2006. X/fonts 4 dict def
  2007. Xfonts begin
  2008. X    /C /NewCenturySchlbk-Roman def    % Comments
  2009. X    /K /Courier-Bold def        % Keywords
  2010. X    /S /Courier-Oblique def        % Strings
  2011. X    /I /Courier def            % The rest
  2012. Xend
  2013. X
  2014. X/lcont (\274) def    % Line continuation char (ellipsis)
  2015. X%%EndProlog
  2016. SHAR_EOF
  2017. if test 4116 -ne "`wc -c < 'pps.pro'`"
  2018. then
  2019.     echo shar: "error transmitting 'pps.pro'" '(should have been 4116 characters)'
  2020. fi
  2021. fi
  2022. echo shar: "extracting 'slide.pro'" '(2458 characters)'
  2023. if test -f 'slide.pro'
  2024. then
  2025.     echo shar: "will not over-write existing file 'slide.pro'"
  2026. else
  2027. sed 's/^X//' << \SHAR_EOF > 'slide.pro'
  2028. X% $Header: slide.pro,v 0.0 88/06/22 05:22:44 on Rel $
  2029. X% General macros
  2030. X/curx { currentpoint pop } def
  2031. X/cury { currentpoint exch pop } def
  2032. X/min { 2 copy gt { exch } if pop } def
  2033. X/max { 2 copy lt { exch } if pop } def
  2034. X
  2035. X/vecop {
  2036. X% [ v1x v1y ] [ v2x v2y ] { op } vecop [ v1x v2x { op } v1y v2y { op } ]
  2037. X    3 1 roll aload pop
  2038. X    3 2 roll aload pop
  2039. X    3 2 roll
  2040. X    5 -1 roll dup 6 1 roll exec
  2041. X    exch 4 2 roll exch exec
  2042. X    exch
  2043. X    [ 3 1 roll ]
  2044. X} def
  2045. X% Automatic stretching
  2046. X/pagedim { % - pagedim [ llx lly ] [ urx ury ]
  2047. X    initclip clippath pathbbox
  2048. X    [ 3 1 roll ]
  2049. X    3 1 roll
  2050. X    [ 3 1 roll ]
  2051. X} def
  2052. X
  2053. X/ndim { % - ndim [ nx ny ]
  2054. X    [ I setfont (n) stringwidth pop dy ]
  2055. X} def
  2056. X
  2057. X/stretch { % w h stretch -
  2058. X    dup
  2059. X    % How much can we magnify?
  2060. X    pagedim { sub } vecop margin { sub } vecop    % page space
  2061. X    exch { div } vecop
  2062. X    aload pop min exch
  2063. X    % How much can we magnify on rotated page?
  2064. X    [ pagedim { sub } vecop margin { sub } vecop aload pop exch ]
  2065. X    exch { div } vecop
  2066. X    aload pop min exch
  2067. X
  2068. X    gsave
  2069. X    2 copy
  2070. X    gt {    % landscape
  2071. X        pagedim exch pop
  2072. X        margin [ 2 2 ] { div } vecop { add } vecop
  2073. X        aload pop translate
  2074. X        90 rotate
  2075. X        pop dup scale
  2076. X    } {    % portrait
  2077. X        [ pagedim 0 get exch 1 get ]
  2078. X        margin [ 2 -2 ] { div } vecop { add } vecop
  2079. X        aload pop translate
  2080. X        dup scale pop
  2081. X    } ifelse
  2082. X    /txfrm matrix currentmatrix def
  2083. X    grestore
  2084. X} def
  2085. X
  2086. X% pps instructions
  2087. X/fname {    % string fname -
  2088. X    /filename exch def
  2089. X    /pageno 0 def
  2090. X    1 f
  2091. X} def
  2092. X
  2093. X/fdate { /date exch def } def
  2094. X/funct { pop } def
  2095. X
  2096. X/t {    % ntabs t -
  2097. X    { 
  2098. X        curx 1 add
  2099. X        tabwidth div ceiling
  2100. X        tabwidth mul
  2101. X        cury moveto
  2102. X    } repeat
  2103. X} def
  2104. X
  2105. X/n {    % nlines n -
  2106. X    { 0 cury dy sub moveto } repeat
  2107. X} def
  2108. X
  2109. X/f {    % npages f -
  2110. X    {
  2111. X        totalpage 0 gt {
  2112. X            showpage
  2113. X        } if
  2114. X        /totalpage totalpage 1 add def
  2115. X        /pageno pageno 1 add def
  2116. X    } repeat
  2117. X
  2118. X    txfrm setmatrix
  2119. X    0 0 moveto
  2120. X    1 n
  2121. X} def
  2122. X    
  2123. X/s {    % string font s -
  2124. X    setfont
  2125. X    show
  2126. X} def
  2127. X
  2128. X/ppsinit { % width ht ppsinit -
  2129. X    fonts {
  2130. X        findfont ppoints scalefont def
  2131. X    } forall
  2132. X    [ 3 1 roll ] ndim { mul } vecop stretch
  2133. X    /tabwidth ndim 0 get tabstop mul def
  2134. X    /totalpage 0 def
  2135. X} def
  2136. X
  2137. X/ppsdone {    % - ppsdone -
  2138. X    1 f
  2139. X} def
  2140. X
  2141. X% Fonts -- should better be fixed pitch.
  2142. X/fonts 4 dict def
  2143. Xfonts begin
  2144. X    /C /NewCenturySchlbk-Roman def    % Comments
  2145. X    /K /Courier-Bold def        % Keywords
  2146. X    /S /Courier-Oblique def        % Strings
  2147. X    /I /Courier def            % The rest
  2148. Xend
  2149. X
  2150. X% Page parameters
  2151. X/margin [ 60 60 ] def        % x, y margin in points
  2152. X/ppoints 10 def            % pointsize -- do not change!
  2153. X/dy ppoints def            % line spacing, >= ppoints
  2154. X/tabstop 8 def            % ens per tabstop
  2155. X%%EndProlog
  2156. SHAR_EOF
  2157. if test 2458 -ne "`wc -c < 'slide.pro'`"
  2158. then
  2159.     echo shar: "error transmitting 'slide.pro'" '(should have been 2458 characters)'
  2160. fi
  2161. fi
  2162. echo shar: "extracting 'fonts'" '(1016 characters)'
  2163. if test -f 'fonts'
  2164. then
  2165.     echo shar: "will not over-write existing file 'fonts'"
  2166. else
  2167. sed 's/^X//' << \SHAR_EOF > 'fonts'
  2168. X# $Header: fonts,v 0.0 88/06/22 05:22:07 on Rel $
  2169. X# Font name aliases for pps
  2170. X# Has all LaserWriter+ fonts.
  2171. X# PostScript        Nicknames
  2172. XCourier            c
  2173. XCourier-Bold        cb
  2174. XCourier-Oblique        co ci
  2175. XCourier-BoldObluique    cbo cbi cib cob cd
  2176. XTimes-Roman            t
  2177. XTimes-Bold        tb
  2178. XTimes-Italic        to ti
  2179. XTimes-BoldItalic    tbi tbo tib tob td
  2180. XHelvetica        h
  2181. XHelvetica-Bold        hb
  2182. XHelvetica-Oblique    ho hi
  2183. XHelvetica-BoldObluique    hbo hbi hib hob hd
  2184. XSymbol
  2185. XAvantGarde-Book        avantgarde ag
  2186. XAvantGarde-BookOblique    ago ao
  2187. XAvantGarde-Demi        agb ab
  2188. XAvantGrade-DemiOblique    agd ad aib abi aob abo
  2189. XBookman-Demi        bb
  2190. XBookman-DemiItalic    bd bib bbi bob bbo
  2191. XBookman-Light        bookman b
  2192. XBookman-LightItalic    bi bo
  2193. XHelvetica-Narrow    hn n
  2194. XHelvetica-Narrow-Bold    hnb nb
  2195. XHelvetica-Narrow-Oblique    hno hni no ni
  2196. XHelvetica-Narrow-BoldOblique    hnbo nbo hnd nd hnob nob
  2197. XNewCenturySchlbk-Roman        newentury schoolbook century ncs ncsr
  2198. XNewCenturySchlbk-Bold        ncsb
  2199. XNewCenturySchlbk-Italic        ncsi ncso
  2200. XNewCenturySchlbk-BoldItalic    ncsni ncsbo ncsd
  2201. XZapfChancery-MediumItalic    zcmi zc z
  2202. XZapfDingbats
  2203. SHAR_EOF
  2204. if test 1016 -ne "`wc -c < 'fonts'`"
  2205. then
  2206.     echo shar: "error transmitting 'fonts'" '(should have been 1016 characters)'
  2207. fi
  2208. fi
  2209. exit 0
  2210. #    End of shell archive
  2211.  
  2212.  
  2213.